package com.example.text.service.serviceImpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.text.dao.FulewinDao;
import com.example.text.entity.FuleapplyEntity;
import com.example.text.entity.FulewinEntity;
import com.example.text.service.FulewinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


import com.example.text.dao.FuleassociationDao;
import com.example.text.entity.FuleassociationEntity;
import com.example.text.service.FuleassociationService;

import java.util.ArrayList;
import java.util.List;


@Service
public class FuleassociationServiceImpl extends ServiceImpl<FuleassociationDao, FuleassociationEntity> implements FuleassociationService {

    @Autowired
    FuleassociationDao fuleassociationDao;

    @Autowired
    FulewinDao fulewinDao;

   public List<FulewinEntity> FulewinByFuleapplyid(int id){

    List<FuleassociationEntity> fuleassociationEntities= fuleassociationDao.selectList(new QueryWrapper<FuleassociationEntity>().eq("fuleapplyid", id));
     List<FulewinEntity> fulewinEntities=new ArrayList<>();

        for (FuleassociationEntity f :fuleassociationEntities){
         FulewinEntity fulewinEntity=fulewinDao.selectById(f.getFulewinid());
         fulewinEntities.add(fulewinEntity);
        }
      return fulewinEntities;
   }

}